package com.qst.controller;

import com.qst.bean.ProductModel;
import com.qst.service.IProductService;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/product")
public class ProductController {

    @Autowired
    IProductService productService;

    @RequestMapping("/get")
    public String getProduct() {
        return "I am service-product";
    }

    @GetMapping("/detail/{id}")
    public ProductModel getProductById(@PathVariable("id") Long productId) {
        ProductModel product = productService.getProductById(productId);
        return product;
    }

    @PostMapping("add")
    public String addProduct(@RequestBody ProductModel productModel) {
        productService.
    }
}
